package com.aya.simple.listener;

import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.stereotype.Service;

/**
 * @author karen
 */
@Service
public class MvcRefreshListener implements ApplicationListener<ContextRefreshedEvent> {
    @Override
    public void onApplicationEvent(ContextRefreshedEvent event) {
        ApplicationContext applicationContext = event.getApplicationContext();

        System.out.print("id:"+ applicationContext.getId());
        System.out.println(",displayName:"+ applicationContext.getDisplayName());
    }
}
